function distance(x1, y1, x2, y2)

	local x = x1 - x2
	local y = y1 - y2
	local x3 = x * x
	local y3 = y * y
	local d = x3 + y3
	return math.sqrt(d)

end